home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / surfmodl / surfm203.arc / SURFSRC.ARC / PARAMENU.INC < prev    next >
Text File  |  1988-01-30  |  4KB  |  115 lines

  1. procedure PARAMENU;
  2. { Parameters menu to change constants, select options, read a new file,
  3.   or save current settings }
  4.  
  5. var Cmmd: integer;         { user's inputted choice }
  6.     Filename: string[40];  { name of file to get data from }
  7.     c: char;               { input character }
  8.  
  9. begin
  10.   repeat
  11.     openwin (13,6,67,21);
  12.     gotoXY (19,1);
  13.     writeln ('PARAMETERS MENU');
  14.     writeln; writeln;
  15.     writeln ('1  Change Lighting Parameters');
  16.     writeln ('2  System (', Sys_name[GrSys], ')');
  17.     writeln ('3  Eye Coordinates (',Xeye:7:2,',',Yeye:7:2,',',Zeye:7:2,')');
  18.     writeln ('4  Focal Point (',Xfocal:7:2,',',Yfocal:7:2,',',Zfocal:7:2,')');
  19.     writeln ('5  Magnification (',Magnify:7:2,')');
  20.     write   ('6  View Type (');
  21.     if (Viewtype = 0) then
  22.       writeln ('Perspective)')
  23.     else if (Viewtype = 1) then
  24.       writeln ('X-Y)')
  25.     else if (Viewtype = 2) then
  26.       writeln ('X-Z)')
  27.     else
  28.       writeln ('Y-Z)');
  29.     writeln ('7  Read New File From Disk');
  30.     writeln ('8  Save Current Settings (', Inifile,')');
  31.     writeln ('0  Return To Main Menu');
  32.     writeln;
  33.     write ('Command: ');
  34.     Cmmd := getkey;
  35.     if (Cmmd < 0) or ((Cmmd > 8) and (Cmmd <> 10)) then
  36.       write(^G)
  37.     else begin
  38.       writeln (Cmmd);
  39.       case Cmmd of
  40.         1: litemenu;
  41.         2: begin
  42.             setsys;
  43.             if (Ncolors > 1) then begin
  44.               clrscr;
  45.            writeln ('You can choose dithered output or color-shaded output.');
  46.            writeln ('If your monitor is color, you should choose dithering.');
  47.            writeln ('If your monitor is monochrome, you can use either one.');
  48.            write ('  Do you want to use dithering (Y/N)? ');
  49.            c := readkey;
  50.            writeln (c);
  51.  
  52.             if (upcase(c) = 'N') then
  53.               Mono := TRUE
  54.             else
  55.               Mono := FALSE;
  56.           end;
  57.           clrscr;
  58.           writeln ('Use XY Adjustment Factor of 1 for most monitors.');
  59.           writeln ('  A value greater than 1 stretches the image');
  60.           writeln ('  in the X direction; less than 1 shrinks it in');
  61.           writeln ('  the X direction.');
  62.           XYadjust := getonereal (XYadjust, 0.0, 99.0, 'XY Adjustment Factor');
  63.         end; { 2: }
  64.         3: begin
  65.           writeln ('Enter new Eye Coordinates.');
  66.           Xeye := getonereal (Xeye, -99999.0, 99999.0, 'X of Eye');
  67.           Yeye := getonereal (Yeye, -99999.0, 99999.0, 'Y of Eye');
  68.           Zeye := getonereal (Zeye, -99999.0, 99999.0, 'Z of Eye');
  69.           Viewchanged := TRUE;
  70.         end; { 3: }
  71.         4: begin
  72.           writeln ('Enter new Focal Point Coordinates.');
  73.           Xfocal := getonereal (Xfocal, -99999.0, 99999.0, 'X of Focal Point');
  74.           Yfocal := getonereal (Yfocal, -99999.0, 99999.0, 'Y of Focal Point');
  75.           Zfocal := getonereal (Zfocal, -99999.0, 99999.0, 'Z of Focal Point');
  76.           Viewchanged := TRUE;
  77.         end; { 4: }
  78.         5: begin
  79.           Magnify := getonereal(Magnify, 0.0, 99999.0, 'Magnification Factor');
  80.           Viewchanged := TRUE;
  81.         end; { 5: }
  82.         6: begin
  83.           writeln ('A view type of 0 does perspective plotting.');
  84.           writeln ('  1 gives an X-Y plot, 2 gives X-Z, and 3 gives Y-Z.');
  85.           Viewtype := getoneint (Viewtype, 0, 3, 'View Type');
  86.           writeln ('Do you want to show axes (Y/N)? ');
  87.           c := readkey;
  88.           writeln (c);
  89.           if (upcase (c) = 'Y') then
  90.             Showaxes := 1
  91.           else
  92.             Showaxes := 0;
  93.           if (Showaxes > 0) then begin
  94.             writeln ('Enter a real-coordinate length for each axis.');
  95.             Xaxislen := getonereal (Xaxislen, 0.0, 99999.0, 'X Axis Length');
  96.             Yaxislen := getonereal (Yaxislen, 0.0, 99999.0, 'Y Axis Length');
  97.             Zaxislen := getonereal (Zaxislen, 0.0, 99999.0, 'Z Axis Length');
  98.             Axiscolor := getoneint (Axiscolor, 1, Ncolors, 'Axis Color');
  99.           end; { if Showaxes }
  100.           Viewchanged := TRUE;
  101.         end; { 6: }
  102.         7: begin
  103.           write ('Enter new file name: ');
  104.           readln (Filename);
  105.           readfile (Filename);
  106.           Viewchanged := TRUE;
  107.         end; { 7: }
  108.         8: writeini;
  109.         10:; { Return to Main Menu }
  110.         0:;  { Return to Main Menu }
  111.       end; { case Cmmd }
  112.     end;
  113.   until (Cmmd = 0) or (Cmmd = 10)
  114. end; { procedure Paramenu }
  115.